package com.share.controller;


import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author sunxuejian
 * @date 2020/4/23
 */
public class C1_myController implements Controller {
    @Override
    public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {

        ModelAndView mv = new ModelAndView();
        mv.addObject("hello", "欢迎学习springmvc！");

        /**
         * 指定转跳视图：
         * 返回物理视图：mv.setViewName("/WEB-INF/jsps/index.jsp");
         * 返回逻辑视图：
         */
//        mv.setViewName("/WEB-INF/jsps/index.jsp");
        mv.setViewName("index");
        return mv;
    }
}
